package com.opensky.qatest.ui.component;

import org.openqa.selenium.By;

import com.opensky.qatest.ui.component.common.AbstractJoinModal;
import com.opensky.qatest.util.selenium.WebDriverWrapper;

/*
 * Join modal on Category page
 *
 * @author: Aliakse_Khursevich (hursevich@gmail.com)
 * @version: 1.0
 * 
 */
public class CategotyPageJoinModal extends AbstractJoinModal {

    // ************************ Locators ************************

    private static final String CATEGORY_SPEC_IMG = "//div[@id='join-modal']//img[contains(@src, 'modal-category-style.jpg')]";

    private static final String MESSAGE = "//div[@id='join-modal']//div[@class='words' and contains(., 'Shop with our expert curators')]";

    public CategotyPageJoinModal(WebDriverWrapper driver) {
	super(driver);
    }

    // ************************ Validations **************************

    public boolean isCategorySpecificImagePresent() {
	driver.waitAndCheckElementPresent("CATEGORY_SPEC_IMG", By.xpath(CATEGORY_SPEC_IMG));
	return true;
    }

    public boolean isMessagePresent() {
	driver.waitAndCheckElementPresent("MESSAGE", By.xpath(MESSAGE));
	return true;
    }
}
